<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="/WebFinalProject/css/FinalProjectCSS.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="table.js"></script>
<script type="text/javascript">
function goToThread(task,id) {
		document.forms[0].task.value = task;
		document.forms[0].idThread.value = id;
		//alert(task + ', '+ id);
		document.forms[0].submit();
}
function search() {
	document.forms[0].task.value = "search";
	document.forms[0].submit();
}
</script>
<title>Forum Main Page</title>
</head>
<body>
<center>
		<table width="100%" class="bodyTable boxShadow">
		
			<!-- Header -->
			<tr>
				<td colspan="2"><%@include file="/include/Header.jsp"%></td>
			</tr>
		
			<!-- Content -->
			<tr>
				<td rowspan="2" width="200px" class="navigationBox"><%@include file="/include/Navigation.jsp"%></td>
				<td align="left" class="headerBox blueBackground">Forum Discussion</td>
			</tr>
			<tr>
				<td align="center"  class="contentStyle"><br>
					<html:form action="/Forum" method="post">
					
<!-- -------------------------------------- Koding disini ----------------------------------------------------------------------------- -->
						<html:hidden property="task"/>
						<html:hidden property="idThread"/>
						<table width="95%" class="boxShadow">
							<tr class="headerBox greyBackground">
								<td align="right">
									<table>
										<tr>
											<td class="formListStyle">
												Enter Keyword
											</td>
											<td class="formListStyle">
												<html:text property="searchKeyword"></html:text>
											</td>
											<td class="formListStyle">
												<input type="button" value="Search" onclick="search()"/>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						<br/>
						<table border="0" width="95%" align="center" class="boxShadow  example table-autosort table-autofilter  table-autopage:10 table-stripeclass:alternate table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount" id="t1">
						<thead>
						<tr class="headerBox formHeaderBackground">
							<th colspan="3" align="center">Thread Title</th>
							<th colspan="2" align="center" width="15%">Last Post</th>
						</tr>
						</thead>
						<tbody>
						<logic:notEmpty name="forumThreadForm" property="listForumThread">
							<logic:iterate id="listData" name="forumThreadForm" property="listForumThread">
								<tr class="formListBackground">
									<td colspan="3" class="formListStyle leftAlign" style="word-wrap:break-word;">
										<a href="javascript:goToThread('thread','<bean:write name="listData" property="forumThreadId"/>')"><bean:write name="listData" property="threadTitle"/></a><br>
										<div style="padding:0px 5px; font-size:8pt;">>>&nbsp;&nbsp;<bean:write name="listData" property="description"></bean:write></div>
									</td>
									<td colspan="2" align="center" class="formListStyle"><bean:write name="listData" property="lastPostingDate"></bean:write></td>
								</tr>
							</logic:iterate>
						</logic:notEmpty>
						</tbody>
						<tfoot>
							<tr class="headerBox formHeaderBackground">
								<td width="10%" class="table-page:previous formListStyle" style="cursor:pointer;">&lt;&lt; Previous</td>
								<td colspan="3" style="text-align:center; vertical-align: middle;">Page <span id="t1page"></span>&nbsp;of <span id="t1pages"></span></td>
								<td width="55px" class="table-page:next formListStyle rightAlign" style="cursor:pointer;">Next &gt;&gt;</td>
							</tr>
<!-- 							<tr> -->
<!-- 								<td class="table-page:previous" style="cursor:pointer; padding:5px 7px; width: 100px;">&lt; &lt; Previous</td> -->
<!-- 								<td colspan="3" style="text-align:center; vertical-align: middle; width: 200px;">Page <span id="t1page"></span>&nbsp;of <span id="t1pages"></span></td> -->
<!-- 								<td align="right" class="table-page:next" style="cursor:pointer; vertical-align: middle; padding:5px 7px; width: 100px;">Next &gt; &gt;</td> -->
<!-- 							</tr> -->
							<tr>
								<td colspan="5" align="center" class="headerBox formHeaderBackground"><span id="t1filtercount"></span>&nbsp;of <span id="t1allcount"></span>&nbsp;rows match filter(s)</td>
							</tr>
						</tfoot>
						</table>
<!-- -------------------------------------- Sampe disini ----------------------------------------------------------------------------- -->
					
					</html:form><br><br>
				</td>
			</tr>
			
			<!-- Footer -->
			<tr>
				<td align="center" colspan="2" class="headerBox blueBackground">&copy; OME. 2013. All Rights Reserved.</td>
			</tr>
		</table>
	</center>	
</body>
</html>